//
//  GetMyHistoryTask.m
//  ZooNgonDoiOS
//
//  Created by Anh Jun Linh Tinh on 7/4/12.
//  Copyright (c) 2012 Personal. All rights reserved.
//

#import "GetMyHistoryTask.h"

@implementation GetMyHistoryTask

- (id)init
{
    self = [super init];
    if (self) {
        _limit = 0;
    }
    return self;
}

-(id) initWithParam:(int) limit{
    self = [super init];
    if(self){
        _limit = limit;
    }
    return self;
}

-(void) doExecute{
    if (_limit > 0) {
        NSDictionary *params = [NSDictionary dictionaryWithKeysAndObjects:@"limit",_limit,nil];
        [[RKObjectManager sharedManager].client get:@"/my/history" queryParameters:params delegate:self];
    }else{
         [[RKObjectManager sharedManager].client get:@"/my/history" delegate:self];
    }
}

-(void)request:(RKRequest *)request didLoadResponse:(RKResponse *)response{
    
}

-(void) request:(RKRequest *)request didFailLoadWithError:(NSError *)error{
    
}

@end
